
#include <Inklude/ikCNetClientFactory.h>
#include <Windows.h>

using namespace Inklude;

int main(int argc, char* argv[])
{   
    // Create tcp async instance via factory class
    std::shared_ptr<ikINetClient> pClient = ikCNetClientFactory::CreateClient(Inklude::NET_OPTION::TCP_SYNC);

    // If you don't want to use this instance to receive data, you don't need to provide port number.
    pClient->Initialize();

    // You should put destination information. i.e., ip address (domain name) and port number.
    pClient->SetDestinationAddress("127.0.0.1", 9999);

    int count = 0;
    char *buffer = new char[6000];

    while (true)
    {
        count++;
        sprintf(buffer, "this is #%d\n", count);
        // To send data via send method.
        if(6000 == pClient->Send(buffer, 6000))
        {
            printf("%d successed\n", count);
        }
        Sleep(500);
    }

	return 0;
}
